{{include file="default/Public/header.html"}}
<div id="pageTop">
	<div class="tabs"> 
		<ul>
			<li><a href='{{U url="fvote/manage?catid=`$cat.catid`"}}'>管理投票</a></li>
			<li><a href='{{U url="fvote/add?catid=`$cat.catid`"}}'>添加投票</a></li>
			<li><a href='javascript:void(0);' class="selected" rel="tabsContent1">管理问卷</a></li>
			<li><a href='{{U url="fvote/survey_add?catid=`$cat.catid`"}}'>添加问卷</a></li>
		</ul>		
	</div>
</div>
<form id="voteForm" method="post" action="__APP__">
<div id="pageCo">
	<div class="listForm">
		<table cellpadding="0" cellspacing="0">
			<thead>
				<tr>
					<th width="40">ID</th>
				    <th>标题</th>
				    <th width="100">开始时间</th>
				    <th width="100">到期时间</th>
				    <th width="130">创建时间</th>
				    <th width="190">操作</th>
				</tr>
			</thead>
			<tbody> 
				{{foreach from=$data.info item=v}}
				  <tr>
				    <td>{{$v.subjectid}}</td>
				    <td><a href="#" target="_blank">{{$v.subject}}</a></td>
				    <td>{{$v.fromdate}}</td>
				    <td><span {{if 'now'|strtotime - $v.todate|strtotime > 0}}class="red"{{/if}}>{{$v.todate}}</span></td>
				    <td>{{"Y-m-d H:i"|date:$v.create_time}}</td>
				    <td>
				    <a href="javascript:void(0);" onclick="voteshow({{$v.subjectid}});">统计</a> | 
				    <a href='{{U url="fvote/survey_edit?subjectid=`$v.subjectid`&catid=`$cat.catid`"}}'>编辑</a> | 
				    <a href='{{U url="fvote/survey_manage_subject?subjectid=`$v.subjectid`&catid=`$cat.catid`"}}'>主题列表</a> | 
				    <a href='{{U url="fvote/reset?subjectid=`$v.subjectid`&catid=`$cat.catid`"}}'>重置</a> |
				    {{if $v.status == '1'}}
				    <a href='{{U url="fvote/edit?ajax=status&subjectid=`$v.subjectid`&status=0&catid=`$cat.catid`"}}'>禁用</a> | 
				    {{else}}
				    <a href='{{U url="fvote/edit?ajax=status&subjectid=`$v.subjectid`&status=1&catid=`$cat.catid`"}}' style="color:red;">启用</a> | 
				    {{/if}}
				    <a href='{{U url="fvote/delete?subjectid=`$v.subjectid`&catid=`$cat.catid`"}}' onclick="return window.confirm('此操作不可恢复，你确定要删除该模块在系统的注册信息？');">删除</a></td>
				  </tr>
				  {{foreachelse}}
				  <tr>
				  	<td colspan="6" align="center"> 暂时没有数据！</td>
				  </tr>
				  {{/foreach}}
			</tbody>
		</table>	
	</div>	
	<div class="pageList">
		{{$data.pages}}
		<ul class="clearit"></ul> 
	</div>
</div>
<input type="hidden" name="m" value="fvote" />
<input type="hidden" name="a" value="delete" />
</form>
<script type="text/javascript">
function voteshow(subjectid)
{
	window.open ('{{U url="fvote/voteshow?catid=`$cat.catid`&subjectid="}}' + subjectid, 'newwindow', 'height=400, width=500, top=200, left=300, toolbar=no, menubar=no, scrollbars=yes,resizable=yes,location=no, status=no');
}
</script>
{{include file="default/Public/footer.html"}}